package cn.songhaiqing.walle.help;


import android.util.Log;

import cn.songhaiqing.walle.bean.MyApp;
import cn.songhaiqing.walle.ble.utils.WalleBleConfig;

public class SpHelper {
    public static final String AS_IS_CHOOSE_FACEBOOK_NOTY = "AS_IS_CHOOSE_FACEBOOK_NOTY";
    public static final String AS_IS_CHOOSE_GMAIL_NOTY = "AS_IS_CHOOSE_GMAIL_NOTY";
    public static final String AS_IS_CHOOSE_INSTAGRAM_NOTY = "AS_IS_CHOOSE_INSTAGRAM_NOTY";
    public static final String AS_IS_CHOOSE_KAKAOTALK_NOTY = "AS_IS_CHOOSE_KAKAOTALK_NOTY";
    public static final String AS_IS_CHOOSE_LINE_NOTY = "AS_IS_CHOOSE_LINE_NOTY";
    public static final String AS_IS_CHOOSE_LINKEDIN_NOTY = "AS_IS_CHOOSE_LINKEDIN_NOTY";
    public static final String AS_IS_CHOOSE_MESSENGER_NOTY = "AS_IS_CHOOSE_MESSENGER_NOTY";
    public static final String AS_IS_CHOOSE_QQ_NOTY = "AS_IS_CHOOSE_QQ_NOTY";
    public static final String AS_IS_CHOOSE_SKYPE_NOTY = "AS_IS_CHOOSE_SKYPE_NOTY";
    public static final String AS_IS_CHOOSE_TWITTER_NOTY = "AS_IS_CHOOSE_TWITTER_NOTY";
    public static final String AS_IS_CHOOSE_VIBER_NOTY = "AS_IS_CHOOSE_VIBER_NOTY";
    public static final String AS_IS_CHOOSE_VKONTAKTE_NOTY = "AS_IS_CHOOSE_VKONTAKTE_NOTY";
    public static final String AS_IS_CHOOSE_WECHAT_NOTY = "AS_IS_CHOOSE_WECHAT_NOTY";
    public static final String AS_IS_CHOOSE_WHATSUP_NOTY = "AS_IS_CHOOSE_WHATSUP_NOTY";
    public static final String NOTIFICATION_SEND_ID = "NOTIFICATION_SEND_ID";

    public static Boolean getBoolean(String key, boolean defValue) {
        return Boolean.valueOf(MyApp.getIntance().getSharedPreferences().getBoolean(key, defValue));
    }

    public static void putBoolean(String key, boolean value) {
        MyApp.getIntance().getEditor().putBoolean(key, value).commit();
    }

    public static String getString(String key, String defValue) {
        return MyApp.getIntance().getSharedPreferences().getString(key, defValue);
    }

    public static void putString(String key, String value) {
        MyApp.getIntance().getEditor().putString(key, value).commit();
    }

    public static int getInt(String key, int defValue) {
        System.out.printf("getSharedPreferences=" + key);
        Log.e("getSharedPreferences==", key);
        return MyApp.getIntance().getSharedPreferences().getInt(key, defValue);
    }

    public static void putInt(String key, int value) {
        MyApp.getIntance().getEditor().putInt(key, value).apply();
    }

    public static long getLong(String key, long defValue) {
        return MyApp.getIntance().getSharedPreferences().getLong(key, defValue);
    }

    public static void putLong(String key, long value) {
        MyApp.getIntance().getEditor().putLong(key, value).commit();
    }
}
